﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ZHDJ.Data.Models
{
    public class PartyFloatWindow : EntityBase
    {
        #region 字段属性
        /// <summary>
        /// 
        /// </summary>
        public string Title { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        public bool State { get; set; }

        /// <summary>
        /// 内容
        /// </summary>
        public string Content { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string CreateBy { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public DateTime? CreateTime { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string ModifyBy { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public DateTime? ModifyTime { get; set; }

        /// <summary>
        /// 首页显示
        /// </summary>
        public bool ShowInPage { get; set; }



        /// <summary>
        /// 内容类型 0  自定义文本  1、网址
        /// </summary>
        public int ContentType { get; set; }

        /// <summary>
        /// 网址
        /// </summary>
        public string ContentUrl { get; set; }
        /// <summary>
        /// 飘窗位置
        /// </summary>
        public string Position { get; set; }
        /// <summary>
        /// 图片地址
        /// </summary>
        public string ImgUrl { get; set; }

        #endregion

        public static DataSet GetSuoyeData()
        {

            StringBuilder sbSql = new StringBuilder();
            sbSql.Append(@"SELECT * from tblPartyFloatWindow Data  
Where ifnull(position,'')<>''
and ShowInPage=1 ORDER BY ShowInPage DESC,createTime DESC LIMIT 0,3  ");
            return MySqlHelper.ExecuteDataSet(sbSql.ToString());
        }
    }
}
